﻿using System;
using System.Collections.Generic;
using Scrips.PlayerData;

namespace Scrips.CharacterBehavior
{
    /// <summary>
    /// 玩家行为配置
    /// </summary>
    public static class GamePlayerModeConfig
    {
        /// <summary>
       /// 创造玩家行为字典
       /// </summary>
       /// <param name="mPlayer"></param>
       /// <returns></returns>
        public static Dictionary<PlayerState,PlayerBaseMode> CreatGameModeDict(Player_Cc mPlayer)
        {

            var mDict = new Dictionary<PlayerState,PlayerBaseMode>();
            //统一注册 状态方法
            mDict.Add(PlayerState.Idle, new Idle());
            mDict.Add(PlayerState.WalkUp, new WalkUp());
            mDict.Add(PlayerState.WalkDown, new WalkDown());
            mDict.Add(PlayerState.WalkLeft, new WalkLeft());
            mDict.Add(PlayerState.WalkRight, new WalkRight());
            mDict.Add(PlayerState.Jump, new Jump());
            mDict.Add(PlayerState.Run, new Run());
            mDict.Add(PlayerState.Sprint, new Sprint());
            mDict.Add(PlayerState.Dodge, new Dodge());
            //统一执行一遍初始化
            foreach (var item in mDict)
            {
                item.Value.Init(mPlayer);
            }

            return mDict;
        }
  


    }
}   